public class TestWays {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "旺财"; // 初始化 name，否则输出 null
        dog.sleep();
        dog.eat();
        dog.bark();
    }
}